package com.zhongke.cotrun.controller.manager;

import com.zhongke.cotrun.common.util.APIResponse;
import com.zhongke.cotrun.service.UserAllIntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/manager/UserAllIntegral")
public class UserAllIntegralController {
    @Autowired
    UserAllIntegralService userAllIntegralService;

    /**
     * 查看增自己的积分账户
     *
     * @param userId
     * @return
     */
    @GetMapping("/selectUserAllIntegral")

    public APIResponse selectUserAllIntegral(Integer userId) {
        return APIResponse.returnSuccess(userAllIntegralService.selectUserAllIntegral(userId));
    }

    /**
     * 查看自己账户的积分值
     * @param userId
     * @return
     */
    @GetMapping("/selectUserAllIntegralById")
    public APIResponse selectUserAllIntegralById(Integer userId) {
        return APIResponse.returnSuccess(userAllIntegralService.selectUserAllIntegralById(userId));
    }
}
